package com.androidsocketd.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.androidsocketd.bean.Product;

import java.util.List;


/**
 * Created by yao on 2021/3/23.
 * Describe
 */

@Dao
public interface ProductDao {
    @Query("SELECT * FROM Product")
    List<Product> getAllProducts();

    @Query("SELECT * FROM Product WHERE gridId=:gridId")
    Product getOne(String gridId);

    @Insert
    void insert(Product... users);

    @Insert
    void insert(List<Product> userLists);

    @Update
    void update(Product... users);

    @Update
    void update(List<Product> userLists);
    @Delete
    void delete(Product... users);
    @Delete
    void delete(List<Product> userLists);
}